// export interface IndexModelState {
//     bannerList: Array<any>;
// }

export interface IndexModelType {
    namespace: 'goods';
    state: any;
    reducers: {
        setProps: any
    };
}

const IndexModel: IndexModelType = {
    namespace: 'goods',
    state: {
        desc: "",
        detail: "",
        icon: "",
        name: "",
        star: 0,
    },
    reducers: {
        setProps(state: any, action: any) {
            let newState = JSON.parse(JSON.stringify(state))
            if (action.prop === 'none') {
                newState = {}
            } else {
                newState[action.prop] = action.val
            }
            return newState
        }
    }
};

export default IndexModel;